Introduction

When you develop software products, you’ll most likely collaborate as part of a group. In these groups, each developer works on a different aspect of the project and makes regular changes to the source code as required.

However, these changes don’t always integrate well with the existing code. Or they may not integrate well with code being developed concurrently by another developer. Instances such as these may inadvertently introduce bugs into the project. So, it’s important to maintain track of all changes made to a project and undo any changes that damage the code using version control.

In this reading, you’ll recap the basics of version control and the Git version control system in preparation for your exercise tasks.

Version Control

As you know from previous courses, version control system (or VCS) is a system for maintaining consistency in changes to a project.

There are many different types of VCS, including Git, Subversion, CVS and ClearCase. These different VCS make use of different methodologies. However, the fundamental principal of each remains the same: provide a system that allows a group of individuals to collaborate on a project at the same time.

In this project, you’ll use Git as your VCS. You may be familiar with Git from projects you completed in previous courses. Git is a free and open-source software used to maintain code integrity.

Branching

Version control is the idea that a record can be maintained over time of the changes and activities that have occurred in a project. To facilitate version control for individual users, as well as the team in general, Git enables branching.

Branching involves downloading a copy of the code to a local depository. The user is then free to work on this code as required. Any changes that the user makes can be saved with a meaningful title, such as “bug fix”, “typo” or “function X added”. These changes are recorded with a time stamp so that other users can tell when the changes occurred. If an error is detected, then the user can just roll back the changes to an earlier implementation.

Distributed System

Collaborating on a project as part of a group means that there are many people working on a code base at the same time.

Through branching it is possible for each member of the project to have a local instance on their machine. When a collaborator is happy that their code is ready for distribution then they can add it to the main code repository. This is known as “making a merge”.

During the merging process, Git highlights the changes between the local instance of the code and the centralized version. The programmer is then asked to pick which instance of the code to keep in the central repository.

Conclusion

In this reading, you recapped the basics of version control and Git. You also reviewed the importance of working collaboratively, the obstacles involved, and how you can avoid these obstacles using version control system.